#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>

int main()
{
	chdir("/home/ltw/linux复习/4.process");
	FILE* fp = fopen("log.txt","w");
	if(fp == NULL)
	{
		perror("fopen");
		return 1;
	}
	pid_t id = getpid();
	while(1)
	{
		printf("hello ltw!, I am a process,pid: %d\n",id);
		sleep(1);
	}
	return 0;
}
